package org.eclipseuseradmin.internal.ui.wizards;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.wizard.IWizard;
import org.eclipse.jface.wizard.IWizardNode;
import org.eclipse.swt.graphics.Point;
import org.eclipseuseradmin.internal.ui.WizardElement;
import org.eclipseuseradmin.ui.wizards.INewUserWizard;

public class WizardNode implements IWizardNode {

	private LoginWizard loginWizard;

	private WizardElement wizardElement;

	private INewUserWizard wizard;

	public WizardNode(LoginWizard loginWizard, WizardElement wizardElement) {
		this.wizardElement = wizardElement;
		this.loginWizard = loginWizard;
	}

	public void dispose() {
		// TODO Auto-generated method stub

	}

	public Point getExtent() {
		// TODO Auto-generated method stub
		return null;
	}

	public IWizard getWizard() {

		if (wizard == null) {

			wizard = wizardElement.createWizard();
			((INewUserWizard) wizard).init(loginWizard.getWorkbench(), null,
					loginWizard.getConfirmationCallback(), loginWizard
							.getNameCallback(), loginWizard
							.getPasswordCallback());

		}
		return wizard;
	}

	public boolean isContentCreated() {
		// TODO Auto-generated method stub
		return false;
	}

}
